<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<t:base type="jquery,easyui,tools,DatePicker"></t:base>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:0px;border:0px">
  <t:datagrid name="deviceApplyList"  fitColumns="true" title="活动借用申请" actionUrl="activityBorrowController.do?applyDatagrid" idField="id" fit="true" >
  <t:dgCol title="主键"  field="id"  hidden="true"  queryMode="single"  width="120"></t:dgCol>
  <t:dgCol title="状态值"  field="applyStateValue"  hidden="true"  queryMode="single" width="80" ></t:dgCol> 
  <t:dgCol title="创建日期"  field="createDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请人"  field="applyUser.realName"   queryMode="single"  width="120"></t:dgCol>
  <t:dgCol title="申请日期"  field="applyDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="设备信息"  field="deviceInfo"    queryMode="single"  width="120"></t:dgCol>
  <t:dgCol title="开始使用"  field="beginUseDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
  <t:dgCol title="结束使用"  field="endUseDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
  <t:dgCol title="领用日期"  field="receiveDate" formatter="yyyy-MM-dd"   queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="预约说明"  field="remark"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="申请状态"  field="applyState.name"    queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="是否删除"  field="isDeleted" hidden="true"  queryMode="single"  width="120"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="160"></t:dgCol>
   <t:dgDelOpt title="删除" url="activityBorrowController.do?doDel&id={id}" exp="applyStateValue#eq#0,3"/>
   <t:dgFunOpt funname="submitApply(id)" title="提交申请" exp="applyStateValue#eq#0,3"></t:dgFunOpt>
   <t:dgToolBar title="录入" icon="icon-add" url="activityBorrowController.do?applyAdd" funname="add"></t:dgToolBar>
   <t:dgToolBar title="编辑" icon="icon-edit" url="activityBorrowController.do?applyUpdate" funname="update"></t:dgToolBar>
<%--    <t:dgToolBar title="查看" icon="icon-search" url="deviceAppointApplyController.do?goUpdate" funname="detail"></t:dgToolBar>  --%>
  </t:datagrid>
  </div>
 </div>
 <script type="text/javascript"> 
	function submitApply(id){
		$.dialog.confirm('确定要提交申请吗?', function(r) {
			   if (r) { 
					$.ajax({
						url : 'activityBorrowController.do?submit&id='+id,
						type : 'post', 
						cache : false,
						success : function(data) {
							var d = $.parseJSON(data);
							if (d.success) {
								var msg = d.msg;
								tip(msg);
								reloadTable(); 
							}else{
								tip(msg);
							}
						}
					});
				}
			});
		 
	}
 </script>